#include "_2task.h"
#include "astralapi.h"

/**
 * This is the uniform entry of all task.
 */
void kernel_task_entry(AstralTask task)
{
    runable entry = CAST_AS(runable, task->entry);

    entry(task->param);

    state_change(task, FINISH, True);

    // if run below this line, system error
    while (1)
    {
        kerror("system error\n");
        while (1)
        {
        }
        
    }
}